package org.box.metadata.shell.message;

import org.box.metadata.cli.annotation.Command;

public class ErrorMessageFormatter implements MessageFormatter {

	public static final String ERROR_MESSAGE_FORMATTER = "ErrorMessageFormatter";

	/*
	 * (non-Javadoc)
	 * @see org.box.metadata.shell.message.ShellMessage#getMessage()
	 */
	@SuppressWarnings("rawtypes")
	public String format(Command command, Class[] cfgClasses, Object... args) {
		return ((Throwable) args[0]).getMessage();
	}

	/*
	 * (non-Javadoc)
	 * @see org.box.metadata.shell.message.MessageFormatter#getId()
	 */
	public String getId() {
		return ERROR_MESSAGE_FORMATTER;
	}

}
